package com.liy.jiagou.resources;


import com.liy.jiagou.common.api.entity.ResultVo;
import com.liy.jiagou.feign.CommonPwFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 用户 Controller
 */
@RestController
@RequestMapping("/common")
public class CommonUserPwController {

    private Logger logger = LoggerFactory.getLogger(CommonUserPwController.class);

    @Autowired
    private CommonPwFeignClient commonPwFeignClient;

    /**
    *   需求  查看用户的所有购买的 product
    *
    **/
    @GetMapping("/user/query/pw")
    ResultVo getUserBuyProducts() {

        logger.info("------------------- common-sys-server 调用   pw-server 服务 ------------- " );

        // 调用 product 服务
        ResultVo resultVo = commonPwFeignClient.getPw();

        return resultVo;
    }

}
